//
//  CommonMethod.h
//  PensionTreasure
//
//  Created by Simon on 16/7/4.
//  Copyright © 2016年 柳宣泽. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum {
    MyPensionTotal = 0,   //累计收益
    MypensionYield = 1,   //七日年化
    MyPensionGains = 2,   //万份收益
} MyPensionType;

@interface CommonMethod : NSObject
//1. 判断手机号码格式是否正确，利用正则表达式验证
+ (BOOL)isMobileNumer:(NSString *)mobileNum;

+(BOOL)isHomeNumber:(NSString *)number; //是否是座机；

//2. 判断邮箱格式是否正确，利用正则表达式验证
+ (BOOL)isEamilAvailable:(NSString *)emailAl;

//3. 判断字符串中是否含有空格
+ (BOOL)isHaveSpaceInstring:(NSString *)string;

//4. 判断字符串中是否含有中文
+ (BOOL)isHaveChineseInString:(NSString *)string;

//5. 判断字符串是否全部为数字
+ (BOOL)isPureInteger:(NSString *)string;

//6. 过滤一些特殊字符 只去除头尾的特殊字符【只是去除头和尾的特殊字符】
+ (NSString *)filterSpecialWithString:(NSString *)string;

//9. 处理输入框金额格式
//+ (BOOL)CheckMoney:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;

//11. 错误信息展示
+ (void)showToast:(NSError *)error;
+ (void)showToast1:(NSString *)msg;
//10. 错误信息封装
+ (NSString *)showErrorMessage:(NSError *)error;

//12. 输入框是否输入合法
+ (BOOL)userNameIsRightInputWithString:(NSString*)string;

//13. 创建32位的uuid
+ (NSString*)createUUID ;

//14. 获取背景颜色
//+ (UIColor *)getTheColor;
+ (NSString*)getDateStringFromTimeInterval:(NSString*)timeIntervalString;

/*
 16. 格式化数字计算算法
 algorithmMode=Add        加
 algorithmMode=Subtract   减
 algorithmMode=Multiply   乘
 algorithmMode=Divide     除
 
 */
+ (NSString *)formattedDigitalComputingAlgorithm:(NSString *)algorithmMode firstNumber:(NSString *)firstNum secondNumber:(NSString *)secondNum;
+ (NSString *)formattedDigitalComputingAlgorithm:(NSString *)algorithmMode firstNumber:(NSString *)firstNum secondNumber:(NSString *)secondNum andScale:(int)scale;
/*
 17. 格式化数字计算算法
 从UserDefault中取值
 */
+(NSString *)queryValueFromUserDefaultWithKey:(NSString *)key;
/*
 18.更新UserDefault中的值
 */

+(void)setValueToUserDefaultObject:(NSString *)value WithKey:(NSString *)key;
/*
 19.获取时间字符串
 */

+(NSString * )getNowTimeStringWithFormat:(NSString*)format;

/*
 19.保留小数点后两位
 */
+(NSString * )pointTwoFloatString :(NSString *)pointString;

@end
